import stockApi from "@/api/declaration/erp/stockApi"
import httpRequest from "@/config/axios/httpRequest"
import { StockMoveModel } from "@/models/erp/StockMoveModel"


// ERP 库存调度单 API
export const StockMoveApi = {
  // 查询库存调度单分页
  getStockMovePage: async (params: any) => {
    return await httpRequest.get(stockApi.GetStockMovePage, params)
  },

  // 查询库存调度单详情
  getStockMove: async (id: number) => {
    return await httpRequest.get(stockApi.GetStockMove, { params:{id} })
  },

  // 新增库存调度单
  createStockMove: async (data: StockMoveModel) => {
    return await httpRequest.post(stockApi.CreateStockMove, data)
  },

  // 修改库存调度单
  updateStockMove: async (data: StockMoveModel) => {
    return await httpRequest.put(stockApi.UpdateStockMove, data)
  },

  // 更新库存调度单的状态
  updateStockMoveStatus: async (id: number, status: number) => {
    return await httpRequest.put(stockApi.UpdateStockMoveStatus, { ID: id, Status: status })
  },

  // 删除库存调度单
  deleteStockMove: async (ids: number[]) => {
    return await httpRequest.delete(stockApi.DeleteStockMove, { params: { ids } })
  },

  // 导出库存调度单 Excel
  exportStockMove: async (params) => {
    return await httpRequest.download(stockApi.ExportStockMove, params)
  }
}
